using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DeThi1
{
    public partial class frmThemAlbum : Form
    {
        TruyXuatDuLieu txdl;
        public frmThemAlbum()
        {
            InitializeComponent();
            string strChuoiKetNoi = "provider = microsoft.jet.oledb.4.0;data source = QuanLyBaiHat.mdb;";
            txdl = new TruyXuatDuLieu(strChuoiKetNoi);
            txdl.MoKetNoi();
        }

        private void btnXong_Click(object sender, EventArgs e)
        {
            //frmMainForm main = (frmMainForm)this.Owner;
            //main.CapNhatAlbum(clsAlbum.LayDanhSachAlbum(txdl));
            Application.Restart();
            this.Close();
            
            
        }

        private void btnThem_Click(object sender, EventArgs e)
        {
            clsAlbum album = new clsAlbum();
            album.TENALBUM = txtTenAlbum.Text;
            album.MOTA = txtMoTa.Text;
            album.NGAYPHATHANH = dtpNgayPhatHanh.Value.Day + "/" + dtpNgayPhatHanh.Value.Month + "/" + dtpNgayPhatHanh.Value.Year;

            MessageBox.Show(album.ThemAlbum(txdl));
        }
    }
}